package com.zt.service.impl;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.zt.mapper.LogMapper;
import com.zt.pojo.LogQuery;
import com.zt.pojo.OperateLog;
import com.zt.pojo.PageResult;
import com.zt.service.LogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class LogServiceImpl implements LogService {
    @Autowired
    private LogMapper logMapper;
    @Override
    public PageResult findAll(LogQuery logquery) {
        PageHelper.startPage(logquery.getPage(), logquery.getPageSize());
        List<OperateLog> operateLogList = logMapper.findAll(logquery);
        Page<OperateLog> p =(Page<OperateLog>)operateLogList;
        return new PageResult(p.getTotal(), p.getResult());
    }
}
